<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
    <th:block th:include="include :: header('评价列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.submit(ctx+'evaluation/deleteScore', 'post', 'json')" shiro:hasPermission="evaluation:assess:removeAll">
                <i class="fa fa-remove"></i> 删除评分为零的数据
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>

<div id="main" style="width: 600px;height:400px;"></div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var removeFlag = [[${@permission.hasPermi('evaluation:assess:view')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "evaluation";
    $(function() {
        var options = {
            url:  prefix+ "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "评价列表",

            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号'
                },
                {
                    field: 'user_id',
                    title: '用户编号'
                },
                {
                    field: 'storeName',

                    title: '商铺名称',
                },
                {
                    field: 'locationName',

                    title: '地址',
                },
                {
                    field: 'score',
                    title: '分数',
                },
                {
                    field: 'time',
                    title: '提交时间'
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                       // qwqwqwqwactions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.store_id+'\')"><i class="fa fa-remove"></i>删除</a>&nbsp;');
                       // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id+'\');"><i class="fa fa-remove"></i>删除</a>&nbsp;');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id+'\')"><i class="fa fa-remove"></i>删除</a>&nbsp;');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>

</body>
</html>